Repository navigation
CKS: preserve node offerings during nodeids scale-in - #14459
andrijapanicsb wants to merge 2 commits into
Conversation
Do not infer a global resize when offering parameters are omitted. Keep node-type offerings in count-only accounting and continue processing explicit autoscaling changes without a resize. Add regression coverage for selected-worker removal, mixed and legacy offerings, and autoscaling-only requests. Fixes #14458
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14459 +/- ##
============================================
+ Coverage 18.07% 20.80% +2.73%
- Complexity 16357 20890 +4533
============================================
Files 5937 6053 +116
Lines 537029 548232 +11203
Branches 65833 73239 +7406
============================================
+ Hits 97043 114039 +16996
+ Misses 428901 420812 -8089
- Partials 11085 13381 +2296
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 25.73% |
| Branch coverage | 20.91% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
|
@blueorangutan package |
|
@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19661 |
|
@andrijapanicsb We haven’t tested this PR. Does it also cover this scale-up issue, and is a fix planned for 4.23? |
@modupei 4.23 is not an LTS version. The next path to upgrade will be 24.0. This is aimed at that, but it is not sure yet if it will make it in. |
@andrijapanicsb |
I think these are all for 24.0 :) |
A scale request that changed autoscaling and the worker offering together saved the autoscaling settings and then wrote the old values back. Reload the cluster after autoscaling so the offering update keeps them.
|
@ACSHomeBot package G |
|
Accepted: Planned: RPM + DEB, KVM SystemVM. Status: Completed. Packaging results. |
|
@blueorangutan package |
|
@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging results:
Test packages are available at: |
|
@modupei find the packages above - 24.0.0-snapshot (i.e. built from this PR) |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 20063 |
Live test resultsIn short: this PR was tested on a real CloudStack with real Kubernetes clusters, through the API, the web UI, and with the real cluster-autoscaler. A scale request that names no compute offering now leaves the existing nodes alone, and ordinary clusters with one offering keep working as before. All 20 checks passed. Tested on packages built from Cluster with separate control and worker offerings (API)"Out of date" means the workers were already on a bigger offering (3 GB) while the cluster-wide value still said 2 GB. This is the situation from #14552.
Plain cluster, one offering for all nodes (API)
Web UI
The UI run also showed which callers were exposed. The Scale dialog always sends the current control and worker offerings, so it never hit #14552. The Delete Node button sends only the node ID, which is the #14458 case. API clients and the cluster-autoscaler send no offering at all. Not covered
Noticed in existing code, not caused by this PR
Full report with screenshots: attached PDF. |



Fixes #14458. Fixes #14552. Found during QA for #14223; this is a separate PR based on
main.Fix
A
nodeids-only scale-in could fall back to the old global offering and try to resize unrelated nodes before removing the selected worker.Omitted offering parameters now preserve existing offerings. Count-only accounting uses the node-type offering, and autoscaling-only requests still work without resizing VMs. The normal drain/remove workflow is unchanged.
Testing
138 CKS unit tests passed, including regression tests for selected-worker removal, mixed/legacy offerings and autoscaling-only requests.
Live verification used the #14223 baseline with this fix applied. A request with only the cluster ID and
nodeidsremoved the exact additional worker:Retained nodes stayed Ready with unchanged guest/Kubernetes capacity, allocatable resources, boot IDs and kubelet start times. All 17 resident Pod UIDs/restart counts were unchanged; HTTP/DNS passed. Repeating the removed ID was rejected without changes.
Final cluster: 6 CPU / 7168 MiB. Global RAM returned to 9/~14 GiB after a 13-GiB test peak. Original node placement was restored.
Update for #14552
A scale request that names no offering (
size=N, enabling autoscaling, cluster-autoscaler scale-up) no longer resizes every node to the old cluster-wide offering. New workers use the current worker offering.A request that changes autoscaling and the worker offering together now keeps the autoscaling settings. Before, they were saved and then overwritten with the old values.
Live-tested on packages from
9614df02ac: 20 checks through the API, the web UI and the real cluster-autoscaler, all passed. Results are in this comment.Not covered by this PR: the cluster-wide
serviceofferingidstill shows the old value after a per-group scale. That is tracked in #14702.